package com.baizhi.service2;

import com.baizhi.entrty.Banner;
import com.baizhi.service.BannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class BannerService2Impl implements BannerService2 {
    @Autowired
    private BannerService bs;


    @Override
    public Map xs(int[] id) {
        Map map = new HashMap();

        try {
            bs.xs(id);
            map.put("myxs",true);
        } catch (Exception e) {
            map.put("myxs",false);
            e.printStackTrace();
        }
        return map;
    }

    @Override
    public Map bxs(int[] id) {
        Map map = new HashMap();
        try {
            bs.bxs(id);
            map.put("mybxs",true);
        } catch (Exception e) {
            map.put("mybxs",false);
            e.printStackTrace();
        }

        return map;
    }

    @Override
    public Map insert(Banner ba) {
        Map map = new HashMap();
        try {
            bs.insert(ba);
            map.put("myinsert",true);
        } catch (Exception e) {
            map.put("myinsert",false);
            e.printStackTrace();
        }
        return map;
    }

    @Override
    public Map update(Banner ba) {
        Map map = new HashMap();
        try {
            bs.update(ba);
            map.put("myupdate",true);
        } catch (Exception e) {
            map.put("myupdate",false);
            e.printStackTrace();
        }
        return map;
    }
}
